/**
 * author : YanMing 
 * 2010-03-31
 */


//鏍规嵁ID鍒犻櫎鎸囧畾鐨勭珯鐐�
function deleteById(id){
	if(confirm("")){
		window.location.href="stationDelete.do?id=" + id;
	}
}

//褰撳墠椤垫瘡鏉¤褰曞墠鐨勫閫夋  鍏ㄩ儴閫変腑
function selectAllCheckBox(){
	$(':checkbox').attr('checked','checked');
}
//鍏ㄤ笉閫�
function unselectAllCheckBox(){
	$(':checkbox').attr('checked','');
}
//鍙嶉�
function reverseCheckBox(){
	var arr = $(':checkbox');
	for(var i=0;i<arr.length;i++){
	   arr[i].checked = ! arr[i].checked;
	}
}
//鑾峰彇閫変腑鐨勫閫夋鐨勫� 缁勫拰閫楀彿鍒嗛殧鐨勫瓧绗︿覆
function getSelectCheckBoxValue(){
	var result = [] ;
	$(':checkbox').each(function(){
		if($(this).attr("checked")){
			result.push($(this).val());
		}
	});
	return result.join(",");
}
function getSelectCheckBoxArr(){
	var result = [] ;
	$(':checkbox').each(function(){
		if($(this).attr("checked")){
			result.push($(this).val());
		}
	});
	return result;
}


//鍒犻櫎閫夊畾鐨勭珯鐐逛俊鎭�
function deleteSelectStations(){
	var res = getSelectCheckBoxArr();
	if(res.length < 1){
		alert("鎮ㄦ病鏈夐�鎷╀换浣曡褰曪紝璇烽�鎷╋紒");
		return;
	}
	
	if(confirm("鍒犻櫎" + res.length + "鏉℃暟鎹紝纭畾瑕佸垹闄ゅ悧锛�")){
		window.location.href="deleteMultiStations.do?ids=" + res.join(",");
	}
}

//鍒ゆ柇鏄惁涓哄舰濡�010-01-01鐨勬棩鏈熷瓧绗︿覆
function checkDate(str){
	var r = str.match(/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2})$/); 
    if(r==null)return false; 
    var d= new Date(r[1], r[3]-1, r[4]); 
    return (d.getFullYear()==r[1]&&(d.getMonth()+1)==r[3]&&d.getDate()==r[4]); 
}
/*****************Excel 鏂囦欢瀵煎嚭鐩稿叧***********************/
//瀵煎嚭鎵��绔欑偣 绔欑偣鍩烘湰淇℃伅 涓篍XCEL鏂囦欢
function exportSelectData(type){
	var selectIds = getSelectCheckBoxArr();
	if(selectIds.length < 1){
		alert("鎮ㄦ病鏈夐�鎷╀换浣曡褰曪紝璇烽�鎷╋紒");
		return;
	}
	var url = "exportSelectToExcel.do?export=" + type + "&ids=" + selectIds.join(",");
	window.location.href=url;
}





















